package com.jshoperxms.controller.api.langdu;

import com.jshoperxms.Response;
import com.jshoperxms.components.wechat.check.WxMediaCheckController;
import com.jshoperxms.controller.utils.statickey.TagWords;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by sdywcd on 2019/10/15.
 * Des:
 */
@RestController
@RequestMapping("/api/media/check")
public class YdMediaCheckController {

    @Resource
    private WxMediaCheckController wxMediaCheckController;

    @RequestMapping(value="/checkMsgMedia",method= RequestMethod.POST)
    public ResponseEntity checkMsgMedia(@RequestBody String content){
        Map<String,Object> responsedata=new HashMap<>();
        if(StringUtils.isNotBlank(content)){
            responsedata=wxMediaCheckController.msgSecCheck(content);
            responsedata.put(TagWords.SUCCESS,true);
        }else{
            responsedata.put(TagWords.SUCCESS,false);
        }
        return Response.success(responsedata);
    }


}
